import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
    {
    title: '职工姓名',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '记录时间',
    align:"center",
    dataIndex: 'accessTime'
   },
   {
    title: '是否通过',
    align:"center",
    dataIndex: 'isPass',
    customRender:({text}) => {
       return  render.renderSwitch(text, [{text:'是',value:'Y'},{text:'否',value:'N'}])
     },
   },
   {
    title: '地点',
    align:"center",
    dataIndex: 'place'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '职工姓名',
    field: 'name',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入职工姓名!'},
          ];
     },
  },
  {
    label: '记录时间',
    field: 'accessTime',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入记录时间!'},
          ];
     },
  },
  {
    label: '是否通过',
    field: 'isPass',
     component: 'JSwitch',
     componentProps:{
     }
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入是否通过!'},
          ];
     },
  },
  {
    label: '地点',
    field: 'place',
    component: 'Input',
  },
];
